#include "../Tools/GLHeaders.hpp" 
#include "DisplayFunc.hpp"

#include <cmath>
#include "../Tools/Chrono.hpp"
#include "../Tools/ReferenceCube.hpp"
#include "../Tools/ReferenceFrame.hpp"
#include "../Objet/Objet.hpp"

void DrawGLScene(void){
  static Objet verin;
  static Chrono time;
	static Chrono timeRot;
	static bool init = false;

	if(!init){
    verin.Desactivate();
		time.Activate();
    timeRot.Activate();
		init = true;
	}

	if(time.GetTime() >= 3.0f)
		verin.Activate();
	if(time.GetTime() > 4.0f){
		verin.Desactivate();
		time.Reset();
	}

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  glTranslatef(0.0f, 0.0f,-4.0f);
	glRotatef(80.0f*timeRot.GetTime(), 1.0f, 1.0f, 1.0f);
	glScalef(0.2f, 0.2f, 0.2f);

  verin.Draw();
	ReferenceFrame.Draw();
	ReferenceCube.Draw();
	
	glutSwapBuffers();
}
